/**
 * index.js
 * @authors 杨兴洲（of2502）
 * @date    2017/5/31 0031 16:23
 * @version 1.0
 * @last-modify  杨兴洲（of2502）
 */

import React, {Component} from 'react';
import {StoreProvider} from 'iflux2';
import AppStore from './store';
import MenuToggle from "./component/MenuToggle";
import MenuPreview from "./component/MenuPreview";
import MenuEdit from "./component/MenuEdit";

@StoreProvider(AppStore)
export default class AppContainer extends Component {

    constructor(props) {
        super(props);
        props.store.fetchMenu().then(data => {
            if (data.size > 0) {
                props.store.selectItem(0)

            }
        })
    }

    render() {
        return (
            <div className="wx-menu">
                {/*{JSON.stringify(this.props.store._actorStateList)}*/}
                <MenuToggle />
                <div style={{display: "flex"}}>
                    <MenuPreview />
                    <MenuEdit />
                </div>
            </div>
        )
    }
}